import request from '@/utils/request'

// 获取权限列表
export function list(data) {
  return request({
    url: '/permission/list',
    method: 'post',
    data
  })
}
// 添加权限
export function addPermission(data, headers) {
  return request({
    url: '/permission/addnew',
    method: 'post',
    data,
    headers
  })
}
// 删除权限
export function deletePermission(id, headers) {
  return request({
    url: '/permission/delete',
    method: 'get',
    params: { id },
    headers
  })
}
// 修改权限
export function updatePermission(data, headers) {
  return request({
    url: '/permission/update',
    method: 'post',
    data,
    headers
  })
}
// 获取权限
export function getPermissionById(id) {
  return request({
    url: '/permission/get',
    method: 'get',
    params: { id }
  })
}
